perm filename A50[106,RWF] blob sn#790308 filedate 1985-03-21 generic text, type C, neo UTF8
COMMENT āŠ—   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	I want to write a program that prints the figure below:
C00004 ENDMK
CāŠ—;
I want to write a program that prints the figure below:







The output file that goes to the printer must contain more than the sixteen
asterisks; it must contain at least this much:







or, written in another way,





where I have divided the symbols up into numbered groups in a natural way,
including the blank ("zero times") in the last group to keep all groups of 
the same form. I numbered the groups starting with zero, because that makes
it easier to work out how the number of symbols depends on the group number.
Now I can see that the algorithm can be stated:

	FOR R:= 0 TO 3 DO
		(* PRINT 3-R BLANKS, 1+2R ASTERISKS *)
		(* AND 1 END-OF-LINE *)
		BEGIN
		FOR C:=1 TO 3-R DO WRITE(' ');
		FOR C:=1 TO 1+2*R DO WRITE('*');
		WRITELN
		END

The design was simplified by

(1) Making explicit the existence of the output file as an intermediate stage
    of the output image
(2) Making all symbols visible
(3) Representing the file in the most strictly patterned way possible
(4) Explicitly numbering everything that could be described numerically
(5) Counting from zero.